package be.novelfaces.component.numpaddecsep;

import javax.faces.component.UIComponentBase;

import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.Description;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.TagType;

@JsfComponent(tag = @Tag(type = TagType.Facelets, name = "numpadDecSep"), //
type = AbstractNumpadDecimalSeparator.COMPONENT_TYPE, //
family = AbstractNumpadDecimalSeparator.COMPONENT_FAMILY, //
generate = "be.novelfaces.component.numpaddecsep.NumpadDecimalSeparator", //
renderer = @JsfRenderer(type = AbstractNumpadDecimalSeparator.DEFAULT_RENDERER))
public abstract class AbstractNumpadDecimalSeparator extends UIComponentBase {

	public static final String COMPONENT_TYPE = "be.novelfaces.component.NumpadDecimalSeparator";
	public static final String COMPONENT_FAMILY = "be.novelfaces.component";
	public static final String DEFAULT_RENDERER = "be.novelfaces.component.NumpadDecimalSeparatorRenderer";

	@Attribute(description = @Description(value = "<p>The separator to use when a user presses the numpad decimal separator key. <br/> " //
			+ "Unless you use a predefined variable the string must be exactly one character long for the component to work correctly.</p>" //
			+ "<p>Predefined variables you can use:</p>" //
			+ "<ol>" //
			+ "<li>SPACE (will output \" \")</li>" //
			+ "<li>COMMA (will output \",\")</li>" //
			+ "<li>DEFAULT (use decimal separator from locale from view root)</li>" //
			+ "</ol>" //
			+ "<p>When you don't provide this attribute the decimal separator according to the locale from the ViewRoot will be used.</p>", //
	displayName = "separator"))
	public abstract String getSeparator();

}
